﻿Imports Microsoft.IdentityModel.Protocols.WSIdentity
Imports System.ComponentModel
' DisplayClaimsCollection doesn't support databinding and we have to implement a new collection
Public Class CustomDisplayClaimCollection
    Inherits BindingList(Of CustomDisplayClaim)

End Class

'DisplayClaim has a readonly ClaimType property
Public Class CustomDisplayClaim

    Property claimType As String
    Property displayTag As String
    Property description As String
    Property displayValue As String
    Property [optional] As Boolean

    Public Function GetDiplayClaim() As DisplayClaim
        Return New DisplayClaim(claimType, displayTag, description, displayValue, [optional])
    End Function

    Public Shared Function FromDisplayClaim(ByRef claim As DisplayClaim) As CustomDisplayClaim
        Return New CustomDisplayClaim With {.claimType = claim.ClaimType, .description = claim.Description, .displayTag = claim.DisplayTag, .displayValue = claim.DisplayValue, .optional = claim.Optional}
    End Function

End Class
